package cn.lix.sc.rpc.impl.common.dto;

import cn.lix.sc.rpc.impl.common.annotations.RpcService;

import java.io.Serializable;
import java.util.Map;

/**
 * 增强的RPC请求对象，支持多种内容类型和流式传输
 * @author lix
 * @date 2024
 */
public class EnhancedRpcRequest implements Serializable {

    private static final long serialVersionUID = 267111435107722024L;

    private String serviceClass;
    private String beanName;
    private String methodKey;
    private String parameters;
    
    // 新增字段
    private RpcService.ContentType contentType = RpcService.ContentType.JSON;
    private Map<String, String> headers;
    private String requestId;
    private boolean streaming = false;
    
    // 文件相关
    private byte[] fileData;
    private String fileName;
    private String originalFileName;
    private long fileSize;
    private String fileContentType;

    public EnhancedRpcRequest() {}


    // Getters and Setters
    public String getServiceClass() {
        return serviceClass;
    }

    public void setServiceClass(String serviceClass) {
        this.serviceClass = serviceClass;
    }

    public String getBeanName() {
        return beanName;
    }

    public void setBeanName(String beanName) {
        this.beanName = beanName;
    }

    public String getMethodKey() {
        return methodKey;
    }

    public void setMethodKey(String methodKey) {
        this.methodKey = methodKey;
    }

    public String getParameters() {
        return parameters;
    }

    public void setParameters(String parameters) {
        this.parameters = parameters;
    }

    public RpcService.ContentType getContentType() {
        return contentType;
    }

    public void setContentType(RpcService.ContentType contentType) {
        this.contentType = contentType;
    }

    public Map<String, String> getHeaders() {
        return headers;
    }

    public void setHeaders(Map<String, String> headers) {
        this.headers = headers;
    }

    public String getRequestId() {
        return requestId;
    }

    public void setRequestId(String requestId) {
        this.requestId = requestId;
    }

    public boolean isStreaming() {
        return streaming;
    }

    public void setStreaming(boolean streaming) {
        this.streaming = streaming;
    }

    public byte[] getFileData() {
        return fileData;
    }

    public void setFileData(byte[] fileData) {
        this.fileData = fileData;
    }

    public String getFileName() {
        return fileName;
    }

    public void setFileName(String fileName) {
        this.fileName = fileName;
    }

    public String getOriginalFileName() {
        return originalFileName;
    }

    public void setOriginalFileName(String originalFileName) {
        this.originalFileName = originalFileName;
    }

    public long getFileSize() {
        return fileSize;
    }

    public void setFileSize(long fileSize) {
        this.fileSize = fileSize;
    }

    public String getFileContentType() {
        return fileContentType;
    }

    public void setFileContentType(String fileContentType) {
        this.fileContentType = fileContentType;
    }

    @Override
    public String toString() {
        return "EnhancedRpcRequest{" +
                "serviceClass='" + serviceClass + '\'' +
                ", beanName='" + beanName + '\'' +
                ", methodKey='" + methodKey + '\'' +
                ", contentType=" + contentType +
                ", requestId='" + requestId + '\'' +
                ", streaming=" + streaming +
                ", fileSize=" + fileSize +
                '}';
    }
} 